Optimal. Leaf size=107 \[ \frac{2 \left (a^2 C+3 a b B+b^2 C\right ) \sin (c+d x)}{3 d}+\frac{1}{2} x \left (2 a^2 B+2 a b C+b^2 B\right )+\frac{b (2 a C+3 b B) \sin (c+d x) \cos (c+d x)}{6 d}+\frac{C \sin (c+d x) (a+b \cos (c+d x))^2}{3 d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.159257, antiderivative size = 107, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 3, integrand size = 38, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.079, Rules used = {3029, 2753, 2734} \[ \frac{2 \left (a^2 C+3 a b B+b^2 C\right ) \sin (c+d x)}{3 d}+\frac{1}{2} x \left (2 a^2 B+2 a b C+b^2 B\right )+\frac{b (2 a C+3 b B) \sin (c+d x) \cos (c+d x)}{6 d}+\frac{C \sin (c+d x) (a+b \cos (c+d x))^2}{3 d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3029
Rule 2753
Rule 2734
Rubi steps
\begin{align*} \int (a+b \cos (c+d x))^2 \left (B \cos (c+d x)+C \cos ^2(c+d x)\right ) \sec (c+d x) \, dx &=\int (a+b \cos (c+d x))^2 (B+C \cos (c+d x)) \, dx\\ &=\frac{C (a+b \cos (c+d x))^2 \sin (c+d x)}{3 d}+\frac{1}{3} \int (a+b \cos (c+d x)) (3 a B+2 b C+(3 b B+2 a C) \cos (c+d x)) \, dx\\ &=\frac{1}{2} \left (2 a^2 B+b^2 B+2 a b C\right ) x+\frac{2 \left (3 a b B+a^2 C+b^2 C\right ) \sin (c+d x)}{3 d}+\frac{b (3 b B+2 a C) \cos (c+d x) \sin (c+d x)}{6 d}+\frac{C (a+b \cos (c+d x))^2 \sin (c+d x)}{3 d}\\ \end{align*}
Mathematica [A] time = 0.216213, size = 90, normalized size = 0.84 \[ \frac{6 (c+d x) \left (2 a^2 B+2 a b C+b^2 B\right )+3 \left (4 a^2 C+8 a b B+3 b^2 C\right ) \sin (c+d x)+3 b (2 a C+b B) \sin (2 (c+d x))+b^2 C \sin (3 (c+d x))}{12 d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.039, size = 114, normalized size = 1.1 \begin{align*}{\frac{1}{d} \left ({\frac{{b}^{2}C \left ( 2+ \left ( \cos \left ( dx+c \right ) \right ) ^{2} \right ) \sin \left ( dx+c \right ) }{3}}+{b}^{2}B \left ({\frac{\cos \left ( dx+c \right ) \sin \left ( dx+c \right ) }{2}}+{\frac{dx}{2}}+{\frac{c}{2}} \right ) +2\,abC \left ( 1/2\,\cos \left ( dx+c \right ) \sin \left ( dx+c \right ) +1/2\,dx+c/2 \right ) +2\,abB\sin \left ( dx+c \right ) +{a}^{2}C\sin \left ( dx+c \right ) +{a}^{2}B \left ( dx+c \right ) \right ) } \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 1.035, size = 146, normalized size = 1.36 \begin{align*} \frac{12 \,{\left (d x + c\right )} B a^{2} + 6 \,{\left (2 \, d x + 2 \, c + \sin \left (2 \, d x + 2 \, c\right )\right )} C a b + 3 \,{\left (2 \, d x + 2 \, c + \sin \left (2 \, d x + 2 \, c\right )\right )} B b^{2} - 4 \,{\left (\sin \left (d x + c\right )^{3} - 3 \, \sin \left (d x + c\right )\right )} C b^{2} + 12 \, C a^{2} \sin \left (d x + c\right ) + 24 \, B a b \sin \left (d x + c\right )}{12 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 1.4496, size = 201, normalized size = 1.88 \begin{align*} \frac{3 \,{\left (2 \, B a^{2} + 2 \, C a b + B b^{2}\right )} d x +{\left (2 \, C b^{2} \cos \left (d x + c\right )^{2} + 6 \, C a^{2} + 12 \, B a b + 4 \, C b^{2} + 3 \,{\left (2 \, C a b + B b^{2}\right )} \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{6 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] time = 1.56496, size = 343, normalized size = 3.21 \begin{align*} \frac{3 \,{\left (2 \, B a^{2} + 2 \, C a b + B b^{2}\right )}{\left (d x + c\right )} + \frac{2 \,{\left (6 \, C a^{2} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{5} + 12 \, B a b \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{5} - 6 \, C a b \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{5} - 3 \, B b^{2} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{5} + 6 \, C b^{2} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{5} + 12 \, C a^{2} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{3} + 24 \, B a b \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{3} + 4 \, C b^{2} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{3} + 6 \, C a^{2} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) + 12 \, B a b \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) + 6 \, C a b \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) + 3 \, B b^{2} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) + 6 \, C b^{2} \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{2} + 1\right )}^{3}}}{6 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]